Flash("ObjectLabel","Command/Path")
|
|
|
|
Specify a command you want to execute in Flash player.
Possible commands:
PLAY - play the Flash movie.
STOP - stop the Flash movie.
LOOP - loop the Flash movie.
SHOWMENU - show the Flash movie rclick menu.
HIDEMENU - hide the Flash movie rclick menu.
MINMENU - show the minimalized Flash movie rclick menu.
FULLMENU - show the full Flash movie rclick menu. BACK - jump to the previous frame of the Flash movie.
FORWARD - jump to the next frame of the Flash movie.
REWIND - rewind the Flash movie.
Anything else in EVENT parameter (including string variables)
will be opened as a file or url flash movie.
|
|
|
|
|
This small example will show the OpenFile
dialog (with predefined mask) and after your
selection will load and run the selected Flash movie:
OpenFile("Flash
Files (*.swf)|*.swf|All
Files|*.*||","*.swf")
If (OpenFile$
<> '') Then
Flash("Flash","OpenFile$")
Flash("Flash","PLAY")
End
For more examples
check the flash_examples.mbd or
flash_menu_on_master_page.mbd
files or some
more here.
|
|
|
|
|
MINMENU and
FULLMENU is
useless in a
combination
with HIDEMENU
option.
|
|
|
FlashGetVar("ObjectLabel","FlashVar/MMBVar")
|
|
|
|
Get variable from flash movie defined by name, and store it
in mmb variable
Note: Variable must exist in Flash movie prior to
calling it. Because the Flash actions are called
asynchronously, then the result of the actions can be returned
at an indeterminate time. Therefore, if you are not sure, if
the called variable in the Flash movie already exist (or is
filled), then use Pause()
command in your MMB script to pause the MMB prior to calling
the FlashGetVar
or
FlashSetVar. This should
give the Flash movie a sufficient time to completing the
running tasks and filling the variable that you want to get
from Flash movie. Another way is calling the MMB commands
directly from Flash.
However, this requires a direct access to Flash movie source
file (*.fla) and recompiling the Flash movie.
|
|
|
|
|
This small example is taken from
flash_examples.mbd
file that is available in
Samples\Flash_Examples folder (with all
Flash sources). It will show you a real
example how to Set or Get variable
to/from a Flash movie:
FlashStr$=
'MmbText.mmbstr,'+
'GetDateTime'
** Set the
'GetDateTime'
string to
MmbText.mmbstr
variable located in Flash
movie
FlashSetVar("Flash","FlashStr$")
** Give the Flash a little
time to processing all the needed
actions.
Pause("100")
** Date$ and Time$
variable were filled directly from Flash by
below two lines code:
** fscommand
("mmb","Date$ =" + MMBCurDateFull);
** fscommand ("mmb","Time$ =" +
MMBCurTimeFull);
LoadText("DateStr","Date$")
LoadText("TimeStr","Time$")
** but the Day$
variable is read by FlashGetVar
command directly from MMB
FlashGetVar("Flash","MmbText.MMBCurDay,Day$")
LoadText("DayStr","Day$")
|
|
|
FlashSetVar("ObjectLabel","FlashVar/MMBVar")
|
|
|
|
Set a new value to Flash movie variable.
Note: the same things as for
FlashGetVar command
;-)
|
|
|
FlashSetFrame("ObjectLabel","Frame")
|
|
|
|
This will allow you to go to any frame right from your application.
Simply set the Flash object name to the first parameter
and to the second
parameter set
the frame to
which you want
jump.
|
|
|
|
|
**
Jump to 50th frame
of flash file loaded
in Flash object FlashSetFrame("Flash","50") Flash("Flash","Play")
For more "real"
examples check the
flash_examples.mbd
or flashserie.mbd
files.
|
|
|
FlashGetFrame("ObjectLabel","Variable")
|
|
|
|
Almost the same as FlashSetFrame but it obtains the current frame of the Flash movie.
|
|
|
|
|
**
Returns current
frame of flash file
loaded in Flash
object FlashGetFrame("Flash","CurFrame")
For more "real"
examples check the
flash_examples.mbd
or flashserie.mbd
files.
|
|
|
FlashGetProp("ObjectLabel","Property,Variable")
|
|
|
|
Get a defined property from the Flash movie and store it in
a string variable.
Property can be one of following:
SCALE - returns the scale of Flash movie.
BGCOLOR - returns the RGB code of the background color in the
hexadecimal value (e.g. FF0000 = red color)
QUALITY - returns the current quality level of Flash
player.
PLAYING - returns if movie is playing or not ( e.g.
true/false string)
MOVIE - returns the name of Flash movie.
TOTALFRAMES - returns the number of all frames. ORIGINALWIDTH
- returns the original
width of
flash file. ORIGINALHEIGHT
- returns the original
height of
flash file. PLAYERVERSION
- returns the version
of already installed
Flash player. FILEVERSION
- returns the version
of Flash player
required/used
by a given Flash
file.
|
|
|
|
|
This small example will show you the usage of
FlashGetProp:
** if you wan to return
the background color of played movie, use this
code:
FlashGetProp("Flash","BGCOLOR,bgcolor$")
** or if you want to check
if the Flash movie is playing, then use
this:
FlashGetProp("Flash","PLAYING,play$")
** get
the original width
of the Flash file
(the width in which
was the file originally
created).
FlashGetProp("Flash","ORIGINALWIDTH,owidth$")
For more "real"
examples check the
flash_examples.mbd
or flashserie.mbd
files.
|
|
|
Calling the MMB commands directly from Macromedia Flash
Action Script:
To communication between the Flash movie and MMB is used the
fscommand command. It has two parameters:
command and
arguments . If you want to send a
command to MMB, then the command parameter must be always
string "mmb" and the second parameter (argument) should
contain the MMB scripting action.
Example of usage of fscommand command in Flash
movie:
//
this example will fill the Time$ variable from the Flash variable
fscommand("mmb","Time$ =" + MMBCurTimeFull);
//
this example will call the LoadText MMB command and fill the
DirStr
text object in MMB
fscommand("mmb","LoadText(\"DirStr\",\""+ DirString +"\")");
//
this example will go to next MMB page
fscommand("mmb","NextPage()");
//
this example will go to a defined MMB page - in
this case "Page 2"
fscommand("mmb","Page(\"Page
2\")");
//
this example will run an external mbd file (and jump to "Page
1" of this mbd) from the source folder where the application.exe
is located
fscommand("mmb","RunMBD(\"<SrcDir>\\test_1.mbd\",\"Page
1\")");
|
To include a quotation mark in a string, precede it with a
backslash character (\). This is called "escaping" a
character. There are other characters that cannot be
represented in ActionScript except by special escape
sequences. The following table provides all the ActionScript
escape characters:
Escape sequence
|
Character
|
\b
|
Backspace character (ASCII 8)
|
\f
|
Form-feed character (ASCII 12)
|
\n
|
Line-feed character (ASCII 10)
|
\r
|
Carriage return character (ASCII 13)
|
\t
|
Tab character (ASCII 9)
|
\"
|
Double quotation mark
|
\'
|
Single quotation mark
|
\\
|
Backslash
|
\000 - \377
|
A byte specified in octal
|
\x00 - \xFF
|
A byte specified in hexadecimal
|
\u0000 - \uFFFF
|
A 16-bit Unicode character specified in
hexadecimal
|
Consult the Macromedia Flash documentation for more information about the fscommand command usage and Action Script programming
as such.
|